﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>{$config.sitename}</title>
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta charset="utf-8">
    <link href="/templatesstore/css/cate102_.css" rel="stylesheet" type="text/css" />
    <link href="/templatesstore/css/iscroll.css" rel="stylesheet" type="text/css" />

    <style>
          .slide-bar {
            height: 30%;
            width: 100%;
        }

            .slide-bar img {
                height: 30%;
                width: 100%;
            }

            .slide-bar .title {
                display: block;
                position: absolute;
                height: 12px;
                width: 100%;

                font-size:16px;
                font:bold;
                color:white;
                z-index:300;
                text-align:center;
            }

    </style>
    <script src="/scripts/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script src="/templatesstore/js/swipe_1.js" type="text/javascript"></script>
    <script src="/templatesstore/js/iscroll.js" type="text/javascript"></script>

    <link href="/weixin/pano360/Templates/css/swiper-3.2.7.min.css" rel="stylesheet" />
    <script src="/weixin/pano360/Templates/js/jquery-2.0.2.min.js"></script>
    <script type="text/javascript">
        var myScroll;
        var adScroll;
        function loaded() {
            myScroll = new iScroll('wrapper', {
                snap: true,
                momentum: false,
                hScrollbar: false,
                onScrollEnd: function () {
                    document.querySelector('#indicator > li.active').className = '';
                    document.querySelector('#indicator > li:nth-child(' + (this.currPageX + 1) + ')').className = 'active';
                }
            });
            adScroll = new iScroll('ad_wrapper', {
              snap: true,
              momentum: false,
              hScrollbar: false,
              onScrollEnd: function () {
                document.querySelector('#ad_indicator > li.active').className = '';
                document.querySelector('#ad_indicator > li:nth-child(' + (this.currPageX + 1) + ')').className = 'active';
              }
            });
        }

        document.addEventListener('DOMContentLoaded', loaded, false);
    </script>
    <script>
        $(function () {
            window.swiper_2 = new Swipe(document.getElementById('list_uls'), {
                speed: 500,
                // auto:3000,
                callback: function () {
                    var lis = $(".nav_for_list_ul ul:first-of-type li");
                    lis.removeClass("on").eq(this.index).addClass("on");
                    var las = $(".nav_for_list_ul ul:nth-of-type(2) a");
                    las.removeClass("on").eq(this.index).addClass("on");

                    var minIndex = 0;
                    var maxIndex = Math.max(0, nav_uls.length - 3);
                    var range = [this.index - 1, minIndex, maxIndex];

                    range = range.sort(function (a, b) {
                        return a > b ? 1 : -1;
                    });
                    window.nav_uls.slide(range[1]);
                }
            });
        });
    </script>
</head>

<body id="cate102">
    <div class="banner">
        <div id="wrapper">
            <div id="scroller">
                <ul id="thelist">
                    <vt:function var="hdp" method="getAdvertisement" type="$this" rows="6" />
                    <vt:foreach from="$hdp" item="p" index="i">
                    <li>
                        <p>{$p.title}</p><a href="{$p.linkurl}">
                        <img src="{$p.img_path}"></a>
                    </li>
                    </vt:foreach>
                </ul>
            </div>
        </div>
        <div id="nav">
            <div id="prev" onclick="myScroll.scrollToPage('prev', 0,400,{$hdp.Count});return false">&larr; prev</div>
            <ul id="indicator">
                <vt:foreach from="$hdp" item="p" index="i">
                  <vt:if var="#.i.isfirst" value="true">
                      <li class="active">1</li>
                      <vt:else>
                        <li>{$i}</li>
                      </vt:if>
                </vt:foreach>
            </ul>
            <div id="next" onclick="myScroll.scrollToPage('next', 0,400,{$hdp.Count});return false">next &rarr;</div>
        </div>
        <div class="clr"></div>
    </div>
    <!-- 幻灯片 end-->

    <!--ad stard-->
    <div class="slide-bar">
        <div class="swiper-container">
            <div class="swiper-wrapper">
                <vt:function var="hdp" method="getHdp" type="$this" rows="10" />
                <vt:foreach from="$hdp" item="p" index="i">
                    <div class="title"></div>
                    <div class="swiper-slide">
                       
                        <img src="{$p.img_url}" />
                    </div>
                </vt:foreach>
                <!-- 分页器 -->
                <div class="swiper-pagination"></div>
            </div>
        </div>
    </div>
    <!--ad end-->

    <script src="/weixin/pano360/Templates/js/swiper-3.2.7.min.js"></script>

    <script type="text/javascript">
        var mySwiper = new Swiper('.swiper-container', {
            loop: true,
            // 分页器
            pagination: '.swiper-pagination'
        })
    </script>
    <div id="insert1"></div>

    <!-- 分类 begin-->
    <vt:function var="category" method="getCategory" type="$this" classlayer="1" />

    <section>
        <nav class="nav_for_list_ul">
            <div class="ofh">
                <ul>
                  <vt:foreach from="$category" item="p" index="i">
                      <vt:if var="#.i.isfirst" value="true">
                        <li class="on"></li>
                        <vt:else>
                          <li></li>
                      </vt:if>
                  </vt:foreach>
                </ul>
                <ul>
                    <div id="nav_uls" style="width: 33.3%;">
                        <ol>
                            <vt:foreach from="$category" item="item" index="floor">
                                <vt:if var="#.floor.isfirst" value="true">
                                  <li>
                                    <a href="javascript:swiper_2.slide(<vt:expression var="r" args="$floor" expression="{0}-1" output="true"/>);" class="on">
                                <vt:else>
                                  <li>
                                    <a href="javascript:swiper_2.slide(<vt:expression var="r" args="$floor" expression="{0}-1" output="true"/>);" >
                                </vt:if>
                                  <img src="{$item.ico_url}" />{$item.title}
                                    </a>
                                  </li> 
                            </vt:foreach>
                        </ol>
                    </div>
                </ul>
                <script>
                    window.nav_uls = new Swipe(document.getElementById('nav_uls'), {
                        speed: 500,
                        callback: function () {
                            if (this.index > (this.length - 3)) {
                                this.slide(this.length - 3);
                            }
                        }
                    });
                </script>
            </div>
        </nav>

        <div id="list_uls" class="list_uls box_swipe">
            <ul>
                <vt:foreach from="$category" item="item" index="floor">
                <li> 
                    <dl>
                      <vt:function var="sonCatetory" method="getCategory" type="$this" classlayer="2" parentid="$item.id" />
                          <vt:foreach from="$sonCatetory" item="s" index="sfloor">
                          <dd>
                            <a href="{$s.link_url}">
                              <figure>
                                  <div>
                                      <img src="{$s.ico_url}" />
                                  </div>
                                  <figcaption>
                                      <label>{$s.title}</label>
                                  </figcaption>
                              </figure>
                            </a>
                          </dd>
                         </vt:foreach>
                      </dl>
                  </li>
                </vt:foreach>
            </ul>
        </div>
    </section>

    <script>
        var count = document.getElementById("thelist").getElementsByTagName("img").length;

        for (i = 0; i < count; i++) {
            document.getElementById("thelist").getElementsByTagName("img").item(i).style.cssText = " width:" + document.body.clientWidth + "px";
        }

        document.getElementById("scroller").style.cssText = " width:" + document.body.clientWidth * count + "px";

        setInterval(function () {
            myScroll.scrollToPage('next', 0, 400, count);
        }, 3500);

        window.onresize = function () {
            for (i = 0; i < count; i++) {
                document.getElementById("thelist").getElementsByTagName("img").item(i).style.cssText = " width:" + document.body.clientWidth + "px";
            }

            document.getElementById("scroller").style.cssText = " width:" + document.body.clientWidth * count + "px";
        }
    </script>

    <div id="insert2"></div>
    <div class="copyright">{$config.wcopyright}</div>
    <div style="display: none">©承德广电</div>

    <!--_share_js-->
    <vt:template id="share_js" file="../../csmall/_share_js_index.html" charset="utf-8" />
    <!--/_share_js-->
    <!--_bottommenu-->
    <vt:template id="bottommenu" file="../../bmenu/bottom.html" charset="utf-8" />
    <!--/_bottommenu-->
</body>
</html>
